package com.pig.graduate.service.impl.material;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pig.graduate.domain.material.MaterialPig;
import com.pig.graduate.result.MyResult;
import com.pig.graduate.service.material.MaterialPigService;
import com.pig.graduate.mapper.material.MaterialPigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 星星眼
* @description 针对表【material_pig】的数据库操作Service实现
* @createDate 2023-03-25 16:56:35
*/
@Service
public class MaterialPigServiceImpl extends ServiceImpl<MaterialPigMapper, MaterialPig>
    implements MaterialPigService{

    @Autowired
    private MaterialPigMapper materialPigMapper;


    @Override
    public MyResult materialList(MaterialPig materialPig) {
        PageHelper.startPage(materialPig.getPageNum(),materialPig.getPageSize());
        List<MaterialPig> list = materialPigMapper.materialList(materialPig);
        PageInfo<MaterialPig> pigPageInfo = new PageInfo<>(list);
        return MyResult.success(pigPageInfo);
    }
}




